import sys
import random

'''inp = file(sys.argv[1], 'r')
lines = inp.readlines()
inp.close()

oup = file('output.txt', 'w')

def get_time(s):
	return (float)(s.split(' ')[0])

def get_cmd(s):
	return s.split(' ')[1]

def get_result(s):
	tags = s.split(' ')
	return ' '.join(tags[2 : len(tags)])

for i in range(0, len(lines)):
	lines[i] = lines[i].replace('\n', '')
	if get_cmd(lines[i]) == 'phrase':
		oup.write(get_result(lines[i]) + '\n')

oup.close()'''

inp = file('phrases_.txt', 'r')
lines = inp.readlines()
inp.close()

oup = file('phrases.txt', 'w')

used = [False for i in range(0, len(lines))]
for i in range(0, 5):
	id = 0
	while True:
		id = random.randint(0, len(lines) - 1)
		if used[id] == False:
			break
	used[id] = True
	oup.write(lines[id])

oup.close()
